<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>

<body>

    <script id="demo" type="text/html">
        <ul>
            {{#  layui.each(d.userlist, function(index, item){ }}
            <li>
                <span>{{ item.name }}</span>
                <span>{{ item.age }}</span>
                <button class="del">删除</button>
            </li>
            {{#  }); }}
            {{#  if(d.userlist.length === 0){ }}
            无数据
            {{#  } }}
        </ul>
    </script>

    <div id="view"></div>

    <script src="layui/layui.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <script src="/index.js"></script>
    <script>
        $.index.init()
    </script>
</body>

</html>